package tmpl

import (
	"ims/config"

	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
)

//显示登陆kefu的登陆界面
func PageLogin(r *ghttp.Request) {

	r.Response.WriteTpl("login.html")
}

//进入kefu 的主界面
func PageMain(r *ghttp.Request) {
	r.Response.WriteTpl("main.html")
}

func PageChatMain(r *ghttp.Request) {
	r.Response.WriteTpl("chat_main.html")
}

func PageIndex(r *ghttp.Request) {

	language := config.CreateLanguage("cn")

	r.Response.WriteTpl("index.html", g.Map{
		"Copyright":  language.WebCopyRight,
		"WebDesc":    language.MainIntro,
		"SubIntro":   language.IndexSubIntro,
		"Document":   language.IndexDocument,
		"VisitorBtn": language.IndexVisitors,
		"AgentBtn":   language.IndexAgent,
		"OnlineChat": language.IndexOnlineChat,
		"IndexSend":  language.Send,
		"Lang":       "cn",
	})

}
func PageChat(r *ghttp.Request) {
	kefuId := r.GetQueryString("kefu_id")
	lang := r.GetQueryString("lang", "cn")
	language := config.CreateLanguage(lang)
	refer := r.GetQueryString("refer")
	r.Response.WriteTpl("chat_page.html", g.Map{
		"KEFU_ID": kefuId,
		"SendBtn": language.Send,
		"Lang":    lang,
		"Refer":   refer,
	})
}
